home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / ctlhtmlc / mainfrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-09  |  20.6 KB  |  457 lines

  1. /*---------------------------------------------------------------------------*\
  2.  | MainFrm.cpp  - CtlHTML(tm) Control Library Test Program                   |
  3.  |                Windmill Point Software, Alburg, VT 05440                  |
  4.  |                Copyright (c) 1999, Windmill Point Software                |
  5.  |                All Rights Reserved.                                       |
  6. \*---------------------------------------------------------------------------*/
  7.  
  8. #include "stdafx.h"
  9. #include "CtlHTML Demo.h"
  10. #include "DevUI.h"
  11. #include "MainFrm.h"
  12. #include "..\CtlHtml.h"
  13. #include "Options.h"
  14. #include "Controls.h"
  15. #include "MessageBox.h"
  16. #include "Modeless.h"
  17. #include "resource.h"
  18.  
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24.  
  25. static UINT indicators[] =
  26. {
  27.     ID_SEPARATOR,           // status line indicator
  28. //    ID_INDICATOR_CAPS,
  29. //    ID_INDICATOR_NUM,
  30. //    ID_INDICATOR_SCRL,
  31. };
  32.  
  33. // globals
  34.  
  35. BOOL DisableControls = TRUE;
  36.  
  37. // helper function
  38.  
  39. void ReloadComboList (CComboBox *pCombo, CMcMRUList *pComboMru, LPCTSTR editText)
  40. {
  41.    POSITION pos;
  42.    CString  text;
  43.  
  44.    ASSERT_VALID(pCombo);
  45.    ASSERT_VALID(pComboMru);
  46.  
  47.    // empty list to prevent duplicates
  48.    while (pCombo->DeleteString(0) >= 0)
  49.       ;
  50.  
  51.    // load list
  52.    for (pos = pComboMru->GetHeadPosition(); pos != 0; pComboMru->GetNext(pos))
  53.    {
  54.       text = pComboMru->GetAt(pos);
  55.       pCombo->AddString(text);
  56.    }
  57.  
  58.    // set the edit box text
  59.    pCombo->SetWindowText(editText);
  60. }
  61.  
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CMainFrame
  64.  
  65. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  66.  
  67. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  68.     //{{AFX_MSG_MAP(CMainFrame)
  69.     ON_WM_CREATE()
  70.     ON_WM_CLOSE()
  71.     ON_COMMAND(ID_CUSTOMMESSAGEBOXES, OnMessageBox)
  72.     ON_COMMAND(ID_OPTIONS, OnOptions)
  73.     ON_WM_ACTIVATE()
  74.     ON_COMMAND(ID_CONTROLS, OnControls)
  75.     ON_COMMAND(ID_MODELESS_EXAMPLE, OnModelessExample)
  76.     //}}AFX_MSG_MAP
  77.    ON_WM_SYSCOLORCHANGE()
  78.    ON_WM_FONTCHANGE()
  79. END_MESSAGE_MAP()
  80.  
  81. CMainFrame::CMainFrame()
  82. {
  83. }
  84.  
  85. CMainFrame::~CMainFrame()
  86. {
  87. }
  88.  
  89. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  90. {
  91.     if (!CFrameWnd::PreCreateWindow(cs) )
  92.         return FALSE;
  93.  
  94.    cs.style &= ~FWS_ADDTOTITLE;     // Added to remove "Untitled" from title
  95.     return TRUE;
  96. }
  97.  
  98. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  99. {
  100.    CWinApp *pApp;
  101.  
  102.    // handle window placement    
  103.    CMcWindowPlacement wp;
  104.    wp.RestoreWindowPlacement(_T("MainFrame"), _T("WindowPlacement"), this, TRUE);
  105.  
  106.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  107.         return -1;
  108.  
  109.     if (!m_wndStatusBar.Create(this) ||
  110.         !m_wndStatusBar.SetIndicators(indicators,
  111.           sizeof(indicators)/sizeof(UINT)))
  112.     {
  113.         TRACE0("Failed to create status bar\n");
  114.         return -1;      // fail to create
  115.     }
  116.  
  117.    if ((pApp = AfxGetApp()) == 0)
  118.    {
  119.       ASSERT(FALSE);
  120.       return 0;
  121.    }
  122.  
  123.    TEXTMETRIC  tm;
  124.    CClientDC   dc(0);
  125.    int         cxChar, cyChar, oldCxChar, oldCyChar;
  126.  
  127.    // get the text metrics for the default font
  128.    dc.GetTextMetrics(&tm);
  129.    cxChar = tm.tmAveCharWidth;
  130.    cyChar = tm.tmHeight;
  131.  
  132.    // get the previous text metrics, if any
  133.    oldCxChar = pApp->GetProfileInt(_T("Settings"), _T("CxChar"), -1);
  134.    oldCyChar = pApp->GetProfileInt(_T("Settings"), _T("CyChar"), -1);
  135.  
  136.    // check if changed - small is 7 x 16, large is 9 x 20
  137.    if (cxChar != oldCxChar || cyChar != oldCyChar)
  138.    {
  139.       // If changed, reset all window placements since the window sizes are wrong.
  140.       //    Note that we could keep the MainFrame placement, since it is a sizable window.
  141.       //    All the dialog box placements are wrong and will make the dialog boxes too 
  142.       //    large or too small.
  143.       pApp->WriteProfileBinary(_T("MainFrame"),     _T("WindowPlacement"), 0, 0);
  144.       pApp->WriteProfileBinary(_T("Options"),       _T("WindowPlacement"), 0, 0);
  145.       pApp->WriteProfileBinary(_T("Controls"),      _T("WindowPlacement"), 0, 0);
  146.       pApp->WriteProfileBinary(_T("Message Boxes"), _T("WindowPlacement"), 0, 0);
  147.       pApp->WriteProfileBinary(_T("Modeless"),      _T("WindowPlacement"), 0, 0);
  148.  
  149.       // save the current text metrics
  150.       pApp->WriteProfileInt(_T("Settings"), _T("CxChar"), cxChar);
  151.       pApp->WriteProfileInt(_T("Settings"), _T("CyChar"), cyChar);
  152.    }
  153.  
  154.    // load saved settings
  155.  
  156.    // message box options
  157.    m_MessageTitleMRU.  GetProfile(_T("Message Boxes"), _T("MessageTitle"));
  158.    m_MessageMessageMRU.GetProfile(_T("Message Boxes"), _T("MessageMessage"));
  159.    m_MessageFutureMRU. GetProfile(_T("Message Boxes"), _T("MessageFuture"));
  160.    m_MessageTitleMRU.  m_MaxSize = 10;
  161.    m_MessageMessageMRU.m_MaxSize = 10;
  162.    m_MessageFutureMRU. m_MaxSize = 10;
  163.    m_MessageTitleText    = pApp->GetProfileString(_T("Message Boxes"), _T("MessageTitleText"), 
  164.                               _T("An HTMLMessageBox"));
  165.    m_MessageMessageText  = pApp->GetProfileString(_T("Message Boxes"), _T("MessageMessageText"), 
  166.                               _T("<HTML>This is an example<BR>message using <B>HTML</B>.</HTML>"));
  167.    m_MessageFuture       = pApp->GetProfileString(_T("Message Boxes"), _T("MessageFutureText"));
  168.    m_MessageStandardButtons = pApp->GetProfileInt(_T("Message Boxes"), _T("MessageStandardButtons"), 4);
  169.    m_MessageDefaultButton   = pApp->GetProfileInt(_T("Message Boxes"), _T("MessageDefaultButton"), 0);
  170.    m_MessageResourceIcon    = pApp->GetProfileInt(_T("Message Boxes"), _T("MessageResourceIcon"), 0);
  171.    m_MessageStandardIcon    = pApp->GetProfileInt(_T("Message Boxes"), _T("MessageStandardIcon"), 0);
  172.    m_MessageTimeout         = pApp->GetProfileInt(_T("Message Boxes"), _T("MessageTimeout"), 0);
  173.    m_MessageHelpID          = pApp->GetProfileInt(_T("Message Boxes"), _T("MessageHelpID"), 0);
  174.  
  175.    m_DetailsTitleMRU.  GetProfile(_T("Message Boxes"), _T("DetailsTitle"));
  176.    m_DetailsMessageMRU.GetProfile(_T("Message Boxes"), _T("DetailsMessage"));
  177.    m_DetailsDetailsMRU.GetProfile(_T("Message Boxes"), _T("DetailsDetails"));
  178.    m_DetailsFutureMRU. GetProfile(_T("Message Boxes"), _T("DetailsFuture"));
  179.    m_DetailsTitleMRU.  m_MaxSize = 10;
  180.    m_DetailsMessageMRU.m_MaxSize = 10;
  181.    m_DetailsDetailsMRU.m_MaxSize = 10;
  182.    m_DetailsFutureMRU. m_MaxSize = 10;
  183.    m_DetailsTitleText    = pApp->GetProfileString(_T("Message Boxes"), _T("DetailsTitleText"), 
  184.                               _T("An HTMLDetailsBox"));
  185.    m_DetailsMessageText  = pApp->GetProfileString(_T("Message Boxes"), _T("DetailsMessageText"), 
  186.                               _T("<HTML>This is an example<BR>message using <B>HTML</B>.</HTML>"));
  187.    m_DetailsDetailText   = pApp->GetProfileString(_T("Message Boxes"), _T("DetailsDetailsText"),
  188.                               _T("<HTML>This is an example of details text.<BR>Note that details text can use <B>HTML</B> text as well as <I>regular</I> text.<BR>For line breaks in regular text, the details text needs both a carriage return and a line feed.</HTML>"));
  189.    m_DetailsFuture       = pApp->GetProfileString(_T("Message Boxes"), _T("DetailsFutureText"));
  190.    m_DetailsStandardButtons = pApp->GetProfileInt(_T("Message Boxes"), _T("DetailsStandardButtons"), 3);
  191.    m_DetailsDefaultButton   = pApp->GetProfileInt(_T("Message Boxes"), _T("DetailsDefaultButton"), 0);
  192.    m_DetailsResourceIcon    = pApp->GetProfileInt(_T("Message Boxes"), _T("DetailsResourceIcon"), 0);
  193.    m_DetailsStandardIcon    = pApp->GetProfileInt(_T("Message Boxes"), _T("DetailsStandardIcon"), 0);
  194.    m_DetailsTimeout         = pApp->GetProfileInt(_T("Message Boxes"), _T("DetailsTimeout"), 0);
  195.    m_DetailsHelpID          = pApp->GetProfileInt(_T("Message Boxes"), _T("DetailsHelpID"), 0);
  196.  
  197.    m_FlashTitleMRU.  GetProfile(_T("Message Boxes"), _T("FlashTitle"));
  198.    m_FlashMessageMRU.GetProfile(_T("Message Boxes"), _T("FlashMessage"));
  199.    m_FlashFutureMRU. GetProfile(_T("Message Boxes"), _T("FlashFuture"));
  200.    m_FlashTitleMRU.  m_MaxSize = 10;
  201.    m_FlashMessageMRU.m_MaxSize = 10;
  202.    m_FlashFutureMRU. m_MaxSize = 10;
  203.    m_FlashTitleText    = pApp->GetProfileString(_T("Message Boxes"), _T("FlashTitleText"), 
  204.                            _T("An HTMLFlashBox"));
  205.    m_FlashMessageText  = pApp->GetProfileString(_T("Message Boxes"), _T("FlashMessageText"), 
  206.                            _T("<HTML>This is an example<BR>message using <B>HTML</B>.</HTML>"));
  207.    m_FlashFuture       = pApp->GetProfileString(_T("Message Boxes"), _T("FlashFutureText"));
  208.    m_FlashResourceIcon    = pApp->GetProfileInt(_T("Message Boxes"), _T("FlashResourceIcon"), 0);
  209.    m_FlashStandardIcon    = pApp->GetProfileInt(_T("Message Boxes"), _T("FlashStandardIcon"), 0);
  210.    m_FlashTimeout         = pApp->GetProfileInt(_T("Message Boxes"), _T("FlashTimeout"), 3);
  211.    m_FlashHelpID          = pApp->GetProfileInt(_T("Message Boxes"), _T("FlashHelpID"), 0);
  212.  
  213.    // general options
  214.    m_Typeface       = pApp->GetProfileString(_T("Options"), _T("Typeface"), _T("MS Sans Serif"));
  215.    m_FontSize       = pApp->GetProfileInt   (_T("Options"), _T("FontSize"), 8);
  216.    m_CenterButtons  = pApp->GetProfileInt   (_T("Options"), _T("CenterButtons"), TRUE);
  217.    m_DitherGraphics = pApp->GetProfileInt   (_T("Options"), _T("DitherGraphics"), TRUE);
  218.    m_UseDisabled3D  = pApp->GetProfileInt   (_T("Options"), _T("UseDisabled3D"), FALSE);
  219.    m_HelpPath       = pApp->GetProfileString(_T("Options"), _T("HelpPath"), _T(""));
  220.    DisableControls  = pApp->GetProfileInt   (_T("Options"), _T("DisableControls"), TRUE);
  221.  
  222.    // set CtlHTML Control Library values
  223.    HTMLSetFont(m_Typeface, m_FontSize);
  224.    HTMLSetCenterButtons(m_CenterButtons);
  225.    HTMLSetHelp(m_HelpPath);
  226.    CtlHTMLOptions(m_UseDisabled3D, m_DitherGraphics);
  227.  
  228.     return 0;
  229. }
  230.  
  231. void CMainFrame::OnClose() 
  232. {
  233.    CWinApp *pApp;
  234.  
  235.    if ((pApp = AfxGetApp()) != 0)
  236.    {
  237.       // save settings
  238.  
  239.       // message box options
  240.       m_MessageTitleMRU.  SetProfile(_T("Message Boxes"), _T("MessageTitle"));
  241.       m_MessageMessageMRU.SetProfile(_T("Message Boxes"), _T("MessageMessage"));
  242.       m_MessageFutureMRU. SetProfile(_T("Message Boxes"), _T("MessageFuture"));
  243.       pApp->WriteProfileString(_T("Message Boxes"), _T("MessageTitleText"), m_MessageTitleText);
  244.       pApp->WriteProfileString(_T("Message Boxes"), _T("MessageMessageText"), m_MessageMessageText);
  245.       pApp->WriteProfileString(_T("Message Boxes"), _T("MessageFutureText"), m_MessageFuture);
  246.       pApp->WriteProfileInt(_T("Message Boxes"), _T("MessageStandardButtons"), m_MessageStandardButtons);
  247.       pApp->WriteProfileInt(_T("Message Boxes"), _T("MessageDefaultButton"), m_MessageDefaultButton);
  248.       pApp->WriteProfileInt(_T("Message Boxes"), _T("MessageResourceIcon"), m_MessageResourceIcon);
  249.       pApp->WriteProfileInt(_T("Message Boxes"), _T("MessageStandardIcon"), m_MessageStandardIcon);
  250.       pApp->WriteProfileInt(_T("Message Boxes"), _T("MessageTimeout"), m_MessageTimeout);
  251.       pApp->WriteProfileInt(_T("Message Boxes"), _T("MessageHelpID"), m_MessageHelpID);
  252.  
  253.       m_DetailsTitleMRU.  SetProfile(_T("Message Boxes"), _T("DetailsTitle"));
  254.       m_DetailsMessageMRU.SetProfile(_T("Message Boxes"), _T("DetailsMessage"));
  255.       m_DetailsDetailsMRU.SetProfile(_T("Message Boxes"), _T("DetailsDetails"));
  256.       m_DetailsFutureMRU. SetProfile(_T("Message Boxes"), _T("DetailsFuture"));
  257.       pApp->WriteProfileString(_T("Message Boxes"), _T("DetailsTitleText"), m_DetailsTitleText);
  258.       pApp->WriteProfileString(_T("Message Boxes"), _T("DetailsMessageText"), m_DetailsMessageText);
  259.       pApp->WriteProfileString(_T("Message Boxes"), _T("DetailsDetailsText"), m_DetailsDetailText);
  260.       pApp->WriteProfileString(_T("Message Boxes"), _T("DetailsFutureText"), m_DetailsFuture);
  261.       pApp->WriteProfileInt(_T("Message Boxes"), _T("DetailsStandardButtons"), m_DetailsStandardButtons);
  262.       pApp->WriteProfileInt(_T("Message Boxes"), _T("DetailsDefaultButton"), m_DetailsDefaultButton);
  263.       pApp->WriteProfileInt(_T("Message Boxes"), _T("DetailsResourceIcon"), m_DetailsResourceIcon);
  264.       pApp->WriteProfileInt(_T("Message Boxes"), _T("DetailsStandardIcon"), m_DetailsStandardIcon);
  265.       pApp->WriteProfileInt(_T("Message Boxes"), _T("DetailsTimeout"), m_DetailsTimeout);
  266.       pApp->WriteProfileInt(_T("Message Boxes"), _T("DetailsHelpID"), m_DetailsHelpID);
  267.  
  268.       m_FlashTitleMRU.  SetProfile(_T("Message Boxes"), _T("FlashTitle"));
  269.       m_FlashMessageMRU.SetProfile(_T("Message Boxes"), _T("FlashMessage"));
  270.       m_FlashFutureMRU. SetProfile(_T("Message Boxes"), _T("FlashFuture"));
  271.       pApp->WriteProfileString(_T("Message Boxes"), _T("FlashTitleText"), m_FlashTitleText);
  272.       pApp->WriteProfileString(_T("Message Boxes"), _T("FlashMessageText"), m_FlashMessageText);
  273.       pApp->WriteProfileString(_T("Message Boxes"), _T("FlashFutureText"), m_FlashFuture);
  274.       pApp->WriteProfileInt(_T("Message Boxes"), _T("FlashResourceIcon"), m_FlashResourceIcon);
  275.       pApp->WriteProfileInt(_T("Message Boxes"), _T("FlashStandardIcon"), m_FlashStandardIcon);
  276.       pApp->WriteProfileInt(_T("Message Boxes"), _T("FlashTimeout"), m_FlashTimeout);
  277.       pApp->WriteProfileInt(_T("Message Boxes"), _T("FlashHelpID"), m_FlashHelpID);
  278.  
  279.       // general options
  280.       pApp->WriteProfileString(_T("Options"), _T("Typeface"),       m_Typeface);
  281.       pApp->WriteProfileInt   (_T("Options"), _T("FontSize"),       m_FontSize);
  282.       pApp->WriteProfileInt   (_T("Options"), _T("CenterButtons"),  m_CenterButtons);
  283.       pApp->WriteProfileInt   (_T("Options"), _T("DitherGraphics"), m_DitherGraphics);
  284.       pApp->WriteProfileInt   (_T("Options"), _T("UseDisabled3D"),  m_UseDisabled3D);
  285.       pApp->WriteProfileString(_T("Options"), _T("HelpPath"),       m_HelpPath);
  286.       pApp->WriteProfileInt   (_T("Options"), _T("DisableControls"), DisableControls);
  287.    }
  288.    else
  289.       ASSERT(FALSE);
  290.  
  291.    // handle window placement    
  292.    CMcWindowPlacement wp;
  293.    wp.SaveWindowPlacement(_T("MainFrame"), _T("WindowPlacement"), this);
  294.     CFrameWnd::OnClose();
  295. }
  296.  
  297. void CMainFrame::OnActivate (UINT nState, CWnd* pWndOther, BOOL bMinimized)
  298. {
  299.    CView *pView;
  300.  
  301.    CFrameWnd::OnActivate(nState, pWndOther, bMinimized);
  302.    if (DisableControls && (pView = GetActiveView()) != 0)
  303.       CtlHTMLDialogEnable(pView->m_hWnd, nState != WA_INACTIVE);  // call to enable/disable the CFormView controls
  304. }
  305.  
  306. void CMainFrame::OnSysColorChange ()
  307. {
  308.    CFrameWnd::OnSysColorChange ();
  309.    CtlHTMLSetColors();  // call to change the color of the CtlHTML Control Library graphics
  310. }
  311.  
  312. void CMainFrame::OnFontChange ()
  313. {
  314.    CFrameWnd::OnFontChange ();
  315.    HTMLResetFonts();    // call to reset the CtlHTML Control Library fonts
  316. }
  317.  
  318. void CMainFrame::OnOptions() 
  319. {
  320.    CString oldTypeface = m_Typeface;
  321.    UINT    oldFontSize = m_FontSize;
  322.  
  323.    COptions dialog(_T("Options"), this);
  324.  
  325.    dialog.m_General.m_FontSize        = m_FontSize;
  326.    dialog.m_General.m_Typeface        = m_Typeface;
  327.    dialog.m_General.m_RightJustify    = !m_CenterButtons;
  328.    dialog.m_General.m_DisableControls = DisableControls;
  329.    dialog.m_General.m_DitherGraphics  = m_DitherGraphics;
  330.    dialog.m_General.m_HelpPath        = m_HelpPath;
  331.    dialog.m_General.m_UseDisabled3D   = m_UseDisabled3D;
  332.  
  333.    if (dialog.DoModal() == IDOK)
  334.    {
  335.       m_FontSize        = dialog.m_General.m_FontSize;
  336.       m_Typeface        = dialog.m_General.m_Typeface;
  337.       m_CenterButtons   = !dialog.m_General.m_RightJustify;
  338.       DisableControls   = dialog.m_General.m_DisableControls;
  339.       m_DitherGraphics  = dialog.m_General.m_DitherGraphics;
  340.       m_HelpPath        = dialog.m_General.m_HelpPath;
  341.       m_UseDisabled3D   = dialog.m_General.m_UseDisabled3D;
  342.  
  343.       // set CtlHTML Control Library values
  344.       HTMLSetFont(m_Typeface, m_FontSize);
  345.       HTMLSetCenterButtons(m_CenterButtons);
  346.       HTMLSetHelp(m_HelpPath);
  347.       CtlHTMLOptions(m_UseDisabled3D, m_DitherGraphics);
  348.  
  349.       // invalidate if font has changed
  350.       if (m_Typeface != oldTypeface || m_FontSize != oldFontSize)
  351.          Invalidate();
  352.    }
  353. }
  354.  
  355. void CMainFrame::OnControls() 
  356. {
  357.    CControls dialog(_T("Control Examples"), this);
  358.  
  359.    dialog.DoModal();
  360. }
  361.  
  362. void CMainFrame::OnMessageBox() 
  363. {
  364.    CMessageOptions dialog(_T("Message Boxes (Pro Version Only)"), this);
  365.  
  366.    dialog.m_MessageBoxOptions.m_pTitleMRU      = &m_MessageTitleMRU;
  367.    dialog.m_MessageBoxOptions.m_pMessageMRU    = &m_MessageMessageMRU;
  368.    dialog.m_MessageBoxOptions.m_pFutureMRU     = &m_MessageFutureMRU;
  369.    dialog.m_MessageBoxOptions.m_TitleText      = m_MessageTitleText;
  370.    dialog.m_MessageBoxOptions.m_MessageText    = m_MessageMessageText;
  371.    dialog.m_MessageBoxOptions.m_DisplayInFutureText = m_MessageFuture;
  372.    dialog.m_MessageBoxOptions.m_StandardButtons = m_MessageStandardButtons;
  373.    dialog.m_MessageBoxOptions.m_DefaultButton  = m_MessageDefaultButton;
  374.    dialog.m_MessageBoxOptions.m_ResourceIcon   = m_MessageResourceIcon;
  375.    dialog.m_MessageBoxOptions.m_StandardIcon   = m_MessageStandardIcon;
  376.    dialog.m_MessageBoxOptions.m_Timeout        = m_MessageTimeout;
  377.    dialog.m_MessageBoxOptions.m_HelpID         = m_MessageHelpID;
  378.  
  379.    dialog.m_DetailsBoxOptions.m_pTitleMRU      = &m_DetailsTitleMRU;
  380.    dialog.m_DetailsBoxOptions.m_pMessageMRU    = &m_DetailsMessageMRU;
  381.    dialog.m_DetailsBoxOptions.m_pDetailsMRU    = &m_DetailsDetailsMRU;
  382.    dialog.m_DetailsBoxOptions.m_pFutureMRU     = &m_DetailsFutureMRU;
  383.    dialog.m_DetailsBoxOptions.m_TitleText      = m_DetailsTitleText;
  384.    dialog.m_DetailsBoxOptions.m_MessageText    = m_DetailsMessageText;
  385.    dialog.m_DetailsBoxOptions.m_DetailsText    = m_DetailsDetailText;
  386.    dialog.m_DetailsBoxOptions.m_DisplayInFutureText = m_DetailsFuture;
  387.    dialog.m_DetailsBoxOptions.m_StandardButtons = m_DetailsStandardButtons;
  388.    dialog.m_DetailsBoxOptions.m_DefaultButton  = m_DetailsDefaultButton;
  389.    dialog.m_DetailsBoxOptions.m_ResourceIcon   = m_DetailsResourceIcon;
  390.    dialog.m_DetailsBoxOptions.m_StandardIcon   = m_DetailsStandardIcon;
  391.    dialog.m_DetailsBoxOptions.m_Timeout        = m_DetailsTimeout;
  392.    dialog.m_DetailsBoxOptions.m_HelpID         = m_DetailsHelpID;
  393.  
  394.    dialog.m_FlashBoxOptions.m_pTitleMRU        = &m_FlashTitleMRU;
  395.    dialog.m_FlashBoxOptions.m_pMessageMRU      = &m_FlashMessageMRU;
  396.    dialog.m_FlashBoxOptions.m_pFutureMRU       = &m_FlashFutureMRU;
  397.    dialog.m_FlashBoxOptions.m_TitleText        = m_FlashTitleText;
  398.    dialog.m_FlashBoxOptions.m_MessageText      = m_FlashMessageText;
  399.    dialog.m_FlashBoxOptions.m_DisplayInFutureText = m_FlashFuture;
  400.    dialog.m_FlashBoxOptions.m_ResourceIcon     = m_FlashResourceIcon;
  401.    dialog.m_FlashBoxOptions.m_StandardIcon     = m_FlashStandardIcon;
  402.    dialog.m_FlashBoxOptions.m_Timeout          = m_FlashTimeout;
  403.  
  404.    if (dialog.DoModal() == IDOK)
  405.    {
  406.       m_MessageTitleText       = dialog.m_MessageBoxOptions.m_TitleText;
  407.       m_MessageMessageText     = dialog.m_MessageBoxOptions.m_MessageText;
  408.       m_MessageFuture          = dialog.m_MessageBoxOptions.m_DisplayInFutureText;
  409.       m_MessageStandardButtons = dialog.m_MessageBoxOptions.m_StandardButtons;
  410.       m_MessageDefaultButton   = dialog.m_MessageBoxOptions.m_DefaultButton;
  411.       m_MessageResourceIcon    = dialog.m_MessageBoxOptions.m_ResourceIcon;
  412.       m_MessageStandardIcon    = dialog.m_MessageBoxOptions.m_StandardIcon;
  413.       m_MessageTimeout         = dialog.m_MessageBoxOptions.m_Timeout;
  414.       m_MessageHelpID          = dialog.m_MessageBoxOptions.m_HelpID;
  415.  
  416.       m_DetailsTitleText       = dialog.m_DetailsBoxOptions.m_TitleText;
  417.       m_DetailsMessageText     = dialog.m_DetailsBoxOptions.m_MessageText;
  418.       m_DetailsDetailText      = dialog.m_DetailsBoxOptions.m_DetailsText;
  419.       m_DetailsFuture          = dialog.m_DetailsBoxOptions.m_DisplayInFutureText;
  420.       m_DetailsStandardButtons = dialog.m_DetailsBoxOptions.m_StandardButtons;
  421.       m_DetailsDefaultButton   = dialog.m_DetailsBoxOptions.m_DefaultButton;
  422.       m_DetailsResourceIcon    = dialog.m_DetailsBoxOptions.m_ResourceIcon;
  423.       m_DetailsStandardIcon    = dialog.m_DetailsBoxOptions.m_StandardIcon;
  424.       m_DetailsTimeout         = dialog.m_DetailsBoxOptions.m_Timeout;
  425.       m_DetailsHelpID          = dialog.m_DetailsBoxOptions.m_HelpID;
  426.  
  427.       m_FlashTitleText         = dialog.m_FlashBoxOptions.m_TitleText;
  428.       m_FlashMessageText       = dialog.m_FlashBoxOptions.m_MessageText;
  429.       m_FlashFuture            = dialog.m_FlashBoxOptions.m_DisplayInFutureText;
  430.       m_FlashResourceIcon      = dialog.m_FlashBoxOptions.m_ResourceIcon;
  431.       m_FlashStandardIcon      = dialog.m_FlashBoxOptions.m_StandardIcon;
  432.       m_FlashTimeout           = dialog.m_FlashBoxOptions.m_Timeout;
  433.    }
  434. }
  435.  
  436. void CMainFrame::OnModelessExample() 
  437. {
  438.    CModeless dialog(this);
  439.    dialog.DoModal();
  440. }
  441.  
  442.  
  443. #ifdef _DEBUG
  444.  
  445. void CMainFrame::AssertValid() const
  446. {
  447.     CFrameWnd::AssertValid();
  448. }
  449.  
  450. void CMainFrame::Dump(CDumpContext& dc) const
  451. {
  452.     CFrameWnd::Dump(dc);
  453. }
  454.  
  455. #endif //_DEBUG
  456.  
  457.